package com.ssy.lingxi.order.model.vo.basic.response;

import com.ssy.lingxi.order.model.bo.DeliveryPlanDayBO;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * 计划送货物料订单详情
 * @author czh
 * @version 2.0.0
 * @date 2021-07-15
 */
public class DeliveryPlanOrderQueryVO implements Serializable {

    public DeliveryPlanOrderQueryVO(){}

    public DeliveryPlanOrderQueryVO(String orderNo, String orderDigest, LocalDateTime createTime, BigDecimal purchaseCount, BigDecimal receiveCount, BigDecimal delivered, Long consigneeId, String consignee, String provinceName, String cityName, String districtName, String streetName, String address, String phone,BigDecimal leftCount,Long orderProductId,Long skuId,String productName,Long planOrderId) {
        this.orderNo = orderNo;
        this.orderDigest = orderDigest;
        this.createTime = createTime;
        this.purchaseCount = purchaseCount;
        this.receiveCount = receiveCount;
        this.transitCount = delivered.subtract(receiveCount);
        this.leftCount = leftCount;
        this.planCount = BigDecimal.ZERO;
        this.consigneeId = consigneeId;
        this.consignee = consignee;
        this.provinceName = provinceName;
        this.cityName = cityName;
        this.districtName = districtName;
        this.streetName = streetName;
        this.address = address;
        this.phone = phone;
        this.orderProductId = orderProductId;
        this.skuId = String.valueOf(skuId);
        this.productName = productName;
        this.planOrderId = planOrderId;
    }

    public DeliveryPlanOrderQueryVO(String orderNo, String orderDigest, LocalDateTime createTime, BigDecimal purchaseCount, BigDecimal receiveCount, BigDecimal delivered, Long consigneeId, String consignee, String provinceName, String cityName, String districtName, String streetName, String address, String phone,BigDecimal leftCount,Long orderProductId,Long skuId,String productName,BigDecimal noticeCount) {
        this.orderNo = orderNo;
        this.orderDigest = orderDigest;
        this.createTime = createTime;
        this.purchaseCount = purchaseCount;
        this.receiveCount = receiveCount;
        this.transitCount = delivered.subtract(receiveCount);
        this.leftCount = leftCount;
        this.unplannedCount = noticeCount != null ? purchaseCount.subtract(noticeCount) : BigDecimal.ZERO;
        this.consigneeId = consigneeId;
        this.consignee = consignee;
        this.provinceName = provinceName;
        this.cityName = cityName;
        this.districtName = districtName;
        this.streetName = streetName;
        this.address = address;
        this.phone = phone;
        this.orderProductId = orderProductId;
        this.skuId = String.valueOf(skuId);
        this.productName = productName;
    }

    public DeliveryPlanOrderQueryVO(String orderNo, String orderDigest, LocalDateTime createTime, BigDecimal purchaseCount, BigDecimal receiveCount, BigDecimal delivered, Long consigneeId, String consignee, String provinceName, String cityName, String districtName, String streetName, String address, String phone,BigDecimal leftCount,Long orderProductId,String productNo,String productName,BigDecimal noticeCount,String spec) {
        this.orderNo = orderNo;
        this.orderDigest = orderDigest;
        this.createTime = createTime;
        this.purchaseCount = purchaseCount;
        this.receiveCount = receiveCount;
        this.transitCount = delivered.subtract(receiveCount);
        this.leftCount = leftCount;
        this.unplannedCount = noticeCount != null ? purchaseCount.subtract(noticeCount) : BigDecimal.ZERO;
        this.consigneeId = consigneeId;
        this.consignee = consignee;
        this.provinceName = provinceName;
        this.cityName = cityName;
        this.districtName = districtName;
        this.streetName = streetName;
        this.address = address;
        this.phone = phone;
        this.orderProductId = orderProductId;
        this.skuId = productNo;
        this.productName = productName;
        this.spec = spec;
    }




    /**
     * 送货计划物料订单id
     */
    private Long planOrderId;

    /**
     * 订单编号
     */
    private String orderNo;

    /**
     * 订单商品id
     */
    private Long orderProductId;

    /**
     * 订单skuId，物料sku编号
     */
    private String skuId;

    /**
     * 物料名称
     */
    private String productName;

    /**
     * 订单摘要
     */
    private String orderDigest;

    /**
     * 下单时间
     */
    private LocalDateTime createTime;

    /**
     * 采购数量
     */
    private BigDecimal purchaseCount;

    /**
     * 收货数量
     */
    private BigDecimal receiveCount;

    /**
     * 在途数量
     */
    private BigDecimal transitCount;

    /**
     * 待送货数量
     */
    private BigDecimal leftCount;

    /**
     * 计划送货数量
     */
    private BigDecimal planCount;

    /**
     * 未计划送货数量
     */
    private BigDecimal unplannedCount;

    /**
     * 收货人地址id
     */
    private Long consigneeId;

    /**
     * 收货人姓名
     */
    private String consignee;

    /**
     * 省名称
     */
    private String provinceName;

    /**
     * 市名称
     */
    private String cityName;

    /**
     * 区名称
     */
    private String districtName;

    /**
     * 街道名称
     */
    private String streetName;

    /**
     * 详细地址
     */
    private String address;

    /**
     * 手机号码
     */
    private String phone;

    /**
     * 物料规格
     */
    private String spec;

    /**
     * 计划送货物料订单日期详情
     */
    private List<DeliveryPlanDayBO> planDays;

    public String getSkuId() {
        return skuId;
    }

    public Long getPlanOrderId() {
        return planOrderId;
    }

    public void setPlanOrderId(Long planOrderId) {
        this.planOrderId = planOrderId;
    }

    public void setSkuId(String skuId) {
        this.skuId = skuId;
    }

    public String getProductName() {
        return productName;
    }

    public String getSpec() {
        return spec;
    }

    public void setSpec(String spec) {
        this.spec = spec;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public Long getOrderProductId() {
        return orderProductId;
    }

    public void setOrderProductId(Long orderProductId) {
        this.orderProductId = orderProductId;
    }

    public List<DeliveryPlanDayBO> getPlanDays() {
        return planDays;
    }

    public void setPlanDays(List<DeliveryPlanDayBO> planDays) {
        this.planDays = planDays;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public BigDecimal getUnplannedCount() {
        return unplannedCount;
    }

    public void setUnplannedCount(BigDecimal unplannedCount) {
        this.unplannedCount = unplannedCount;
    }

    public String getOrderDigest() {
        return orderDigest;
    }

    public void setOrderDigest(String orderDigest) {
        this.orderDigest = orderDigest;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public BigDecimal getPurchaseCount() {
        return purchaseCount;
    }

    public void setPurchaseCount(BigDecimal purchaseCount) {
        this.purchaseCount = purchaseCount;
    }

    public BigDecimal getReceiveCount() {
        return receiveCount;
    }

    public void setReceiveCount(BigDecimal receiveCount) {
        this.receiveCount = receiveCount;
    }

    public BigDecimal getTransitCount() {
        return transitCount;
    }

    public void setTransitCount(BigDecimal transitCount) {
        this.transitCount = transitCount;
    }

    public BigDecimal getLeftCount() {
        return leftCount;
    }

    public void setLeftCount(BigDecimal leftCount) {
        this.leftCount = leftCount;
    }

    public BigDecimal getPlanCount() {
        return planCount;
    }

    public void setPlanCount(BigDecimal planCount) {
        this.planCount = planCount;
    }

    public Long getConsigneeId() {
        return consigneeId;
    }

    public void setConsigneeId(Long consigneeId) {
        this.consigneeId = consigneeId;
    }

    public String getConsignee() {
        return consignee;
    }

    public void setConsignee(String consignee) {
        this.consignee = consignee;
    }

    public String getProvinceName() {
        return provinceName;
    }

    public void setProvinceName(String provinceName) {
        this.provinceName = provinceName;
    }

    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    public String getDistrictName() {
        return districtName;
    }

    public void setDistrictName(String districtName) {
        this.districtName = districtName;
    }

    public String getStreetName() {
        return streetName;
    }

    public void setStreetName(String streetName) {
        this.streetName = streetName;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }
}
